<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <cpn></cpn>
    <cpn1 ref="aaa"></cpn1>
    <button v-on:click="btnClick">btnClick</button>


</div>

<template id="a">
    <div>
        {{a}}
    </div>
</template>
<script>
    let cpn = {
        template:"#a",
        data(){
            return {
                a:454
            }
        }
    }
</script>
<script>
    let cpn1 = {
        template:"#a",
        data(){
            return {
                a:454
            }
        },
        methods: {
            cpn1Method(){
                console.log("cpn1Method")
            }
        }
    }
</script>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"></script>
<script>
    const app = new Vue({
        el: "#app",
        data: {
            message: "message"
        },
        methods:{
            btnClick(){
                console.log(this.$children[0].a)
                console.log(this.$refs.aaa.a)
                this.$refs.aaa.cpn1Method()
            }
        },
        components:{
            cpn,
            cpn1
        },
    })
</script>
</body>
</html>